@import "../../../../style/default";

@mixin placeholder($color: $input-placeholder-color) {
  // Firefox
  &::-moz-placeholder {
    color: $color;
    opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
  }
  // Internet Explorer 10+
  &:-ms-input-placeholder {
    color: $color;
  }
  // Safari and Chrome
  &::-webkit-input-placeholder {
    color: $color;
  }
}

// input status
// == when focus or actived
@mixin active($color: $outline-color) {
  border-color: darken($color, 5%);
  outline: 0;
  box-shadow: 0 0 $outline-blur-size $outline-width rgba($color, 0.2);
}

// == when hoverd
@mixin hover($color: $input-hover-border-color) {
  border-color: darken($color, 5%);
}

@mixin disabled() {
  background-color: $input-disabled-bg;
  opacity: 1;
  cursor: not-allowed;
  color: $input-disabled-color;
  border-color: $input-border-color;
  &:hover {
    @include hover($input-border-color);
  }
}

@mixin cadInput() {
  position: relative;
  display: inline-block;
  width: 100%;
  height: $input-height-base;
  padding: $input-padding-vertical-base $input-padding-horizontal-base;
  color: $input-color;
  font-size: $font-size-base;
  line-height: $input-height-base;
  background-color: $input-bg;
  background-image: none;
  border: $border-width-base $border-style-base $input-border-color;
  border-radius: $border-radius-base;
  transition: all 0.3s;
  @include placeholder(); // Reset placeholder

  &:hover {
    @include hover();
  }

  &:focus {
    @include active();
  }
  &-disabled {
    @include disabled();
  }
  &[disable] {
    @include disabled();
  }
}

.cad-tree-menu {
  border: 1px solid #c4c3c3;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 5px;
  cursor: pointer;

  &:hover {
    border-color: #12A1FF;
    color: #12A1FF;
  }
}

.cad-menu-search {
  margin-bottom: 8px;

  input {
    @include cadInput();
  }

  /deep/ .cad-tree-menu-clear {
    margin-right: 4px;
    cursor: pointer;
  }
}

